package com.joysuch.wwyt.attendant.controller;

import com.joysuch.wwyt.attendant.bean.AttendantStatisticsSearchBean;
import com.joysuch.wwyt.attendant.bean.vo.AttendantStatisticsScreenVo;
import com.joysuch.wwyt.attendant.service.AttendantStatisticsService;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description //TODO
 * @Date 2023/2/15 14:45
 * @Author Leong
 **/
@RestController
@RequestMapping("/attendant/statistics")
@Api(tags = "跟班统计")
public class AttendantStatisticsController {

    @Resource
    private AttendantStatisticsService attendantStatisticsService;

    @GetMapping("/person")
    @ApiOperation("人员岗位维度")
    public ResultBean person(AttendantStatisticsSearchBean searchBean) {
        return attendantStatisticsService.findPersonPage(searchBean);
    }

    @GetMapping("/area")
    @ApiOperation("区域维度")
    public ResultBean area(AttendantStatisticsSearchBean searchBean) {
        return attendantStatisticsService.findAreaPage(searchBean);
    }

    @GetMapping("/screen")
    @ApiOperation("跟班完成情况（大屏）")
    public ResultBean screen() {
        AttendantStatisticsScreenVo bean = attendantStatisticsService.findScreen();
        return ResultBean.success(bean);
    }

}
